let defaultState = {
  lists: [
   
  ]
};
const lists = localStorage.getItem("lists")
  ? JSON.parse(localStorage.getItem("lists"))
  : [ {
    title: "消息1",
    content: "我是消息1内容",
    hasRead: false
  },
  {
    title: "消息2",
    content: "我是消息2内容",
    hasRead: false
  },
  {
    title: "消息3",
    content: "我是消息3内容",
    hasRead: false
  },
  {
    title: "消息4",
    content: "我是消息4内容",
    hasRead: false
  }]
  defaultState.lists = lists


const reducer = (state = defaultState, type)=>{
  const newState = JSON.parse(JSON.stringify(state))

  localStorage.setItem('lists', JSON.stringify(newState.lists)) 
  return newState
}
export default reducer